
if (open(CODE_FILE, "language_code.txt")) {
@lan_file = <CODE_FILE>;
	if (open(QT_FILE, "qt_language.txt")) {
		@qt_file = <QT_FILE>;
		open(OUT_FILE, ">code.txt");
		foreach $qt_line (@qt_file) {
			$qt_lan = $qt_line;
			$qt_lan =~ /(\S*)/;
			$qt_lan = $1;
			$found = 0;
			for $lan (@lan_file) {
				$lan =~ /([a-z][a-z])\s*(\S*)/;
				#print "lan:$2\n";
				if ($qt_lan eq $2) {
					printf OUT_FILE ("{QLocale::$qt_lan, \"$1\", KCodecUTF8},\n");
					$found = 1;
					last;
				}
			}
			if ($found == 0) {
				print "could not find code for $qt_lan\n";
				printf OUT_FILE ("{QLocale::$qt_lan, \"\", KCodecUTF8},\n");
			}
		}
	}
}
